/* =========================================
   📦 MAIN
========================================= */

main {
    flex: 1;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body {
    background-image: url('../Imagenes_y_Archivos/FondodepantallaP2.png');
}

/* =========================================
   🧾 INTRO
========================================= */

.intro-text {
    font-size: 15px;
    line-height: 1.6;
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--blanco);
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 900px;
    margin-bottom: 40px;
    text-align: center;
}

/* =========================================
   📋 GRID DE GUÍAS
========================================= */

.guides-grid {
    width: 80%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 28px;
}

/* =========================================
   🎴 TARJETAS
========================================= */

.guide-card {
    background-color: var(--azul-medio);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--sombra-suave);
    transition: all 0.3s ease;
    cursor: pointer;
}

.guide-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: var(--sombra-hover);
}

.card-thumbnail {
    position: relative;
    padding-top: 56.25%;
    background: #000;
    overflow: hidden;
}

.card-thumbnail img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.guide-card:hover .card-thumbnail img {
    transform: scale(1.08);
}

.play-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(35, 102, 196, 0.9);
    color: white;
    width: 65px; height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    transition: all 0.3s ease;
}

.guide-card:hover .play-overlay {
    background: var(--azul-activo);
    transform: translate(-50%, -50%) scale(1.15);
}

.card-content {
    padding: 18px;
    text-align: center;
}

.step-title {
    font-size: 16px;
    color: var(--blanco);
    font-weight: 600;
    line-height: 1.4;
}

/* =========================================
   🎬 MODAL - CORREGIDO (fondo negro)
========================================= */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.88);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 1000px;
    border-radius: 12px;
    padding: 20px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 20px;
    font-size: 36px;
    border: none;
    background: none;
    cursor: pointer;
    color: #333;
    z-index: 10;
}

.modal-close:hover {
    color: var(--rojo);
}

#modal-title {
    text-align: center;
    margin: 0 0 15px 0;
    color: var(--azul-oscuro);
    padding-right: 40px;
}

/* Video Wrapper - Clave para eliminar pantalla negra */
.video-wrapper {
    position: relative;
    padding-top: 56.25%;        /* Aspect ratio 16:9 */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    min-height: 320px;
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;        /* Evita distorsión */
    background: #000;
}

/* Botón de respaldo */
.fallback-btn {
    display: block;
    width: 100%;
    max-width: 420px;
    margin: 25px auto 0;
    padding: 15px 20px;
    background: var(--azul-activo);
    color: white;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.fallback-btn:hover {
    background: var(--azul-oscuro);
    transform: translateY(-3px);
}

/* =========================================
   📱 RESPONSIVE
========================================= */

@media (max-width: 600px) {
    .guides-grid {
        grid-template-columns: 1fr;
        width: 95%;
    }

    .intro-text {
        width: 95%;
    }

    .modal-content {
        width: 95%;
        padding: 15px;
    }
}